package com.tlcx.library.utils;

/**
 * 类型转换工具类
 * Created by victor on 2016/11/18 17:37.
 * Email:zhuzhaoyang@yuanchuangyun.com
 */

public class TypeConvertUtils {

    public static int String2Int(String str) {
        int type = 0;
        try {
            type = Integer.valueOf(str);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return type;
    }

    public static long String2Long(String str) {
        long type = 0;
        try {
            type = Long.valueOf(str);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return type;
    }

    public static double String2Double(String str) {
        double type = 0;
        try {
            type = Double.valueOf(str);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return type;
    }
}
